package com.example.flatlafdemo.action;

import com.example.flatlafdemo.FlatlafDemoApplication;
import com.example.flatlafdemo.components.button.ButtonDemo;
import com.example.flatlafdemo.components.list.ListDemo;
import com.example.flatlafdemo.components.scrollPane.ScrollPaneDemo;
import com.example.flatlafdemo.components.tabbedPane.TabbedPaneDemo;
import com.example.flatlafdemo.components.table.TableDemo;
import com.example.flatlafdemo.components.tree.TreeDemo;
import com.example.flatlafdemo.utils.StringUtil;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;

public class TaskAction extends AbstractAction {

    public TaskAction() {
        super();
    }

    public TaskAction(String name) {
        super(name);
    }

    public TaskAction(String name, Icon icon) {
        super(name, icon);
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        Container container = null;
        switch (e.getActionCommand()) {
            case StringUtil.Button_Demo:
                container = new ButtonDemo();
                break;
            case StringUtil.ColorChooser_Demo:
                break;
            case StringUtil.ComboBox_Demo:
                break;
            case StringUtil.Dialog_Demo:
                break;
            case StringUtil.EditorPane_Demo:
                break;
            case StringUtil.Frame_Demo:
                break;
            case StringUtil.InternalFrame_Demo:
                break;
            case StringUtil.List_Demo:
                container = new ListDemo();
                break;
            case StringUtil.OptionPane_Demo:
                break;
            case StringUtil.ProgressBar_Demo:
                break;
            case StringUtil.ScrollPane_Demo:
                container = new ScrollPaneDemo();
                break;
            case StringUtil.Slider_Demo:
                break;
            case StringUtil.Spinner_Demo:
                break;
            case StringUtil.SplitPane_Demo:
                break;
            case StringUtil.TabbedPane_Demo:
                container = new TabbedPaneDemo();
                break;
            case StringUtil.Table_Demo:
                container = new TableDemo();
                break;
            case StringUtil.TextField_Demo:
                break;
            case StringUtil.ToggleButton_Demo:
                break;
            case StringUtil.ToolTip_Demo:
                break;
            case StringUtil.Tree_Demo:
                container = new TreeDemo();
                break;
            case StringUtil.Window_Demo:
                break;
        }

        if (container != null) {
            FlatlafDemoApplication.frame.updateMainContentPanel(container);
        }
    }
}
